package cn.changein.framework.service.setting.area;

import cn.changein.framework.base.pojo.page.PageInfo;
import cn.changein.framework.model.setting.area.entity.Area;
import cn.changein.framework.model.setting.area.model.params.AreaParam;
import cn.changein.framework.model.setting.area.model.result.AreaChain;
import cn.changein.framework.model.setting.area.model.result.AreaResult;
import cn.changein.framework.model.setting.area.model.result.ListTreeResult;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 地区表 服务类
 * </p>
 *

 * @Date 2020-12-15
 * @Copyright: companyName
 * @Version 1.0
 * @Since JDK1.8
 */
public interface AreaService extends IService<Area> {

    /**
     * 新增
     *

     * @Date 2020-12-15
     */
    void add(AreaParam param);

    /**
     * 删除
     *

     * @Date 2020-12-15
     */
    void delete(AreaParam param);

    /**
     * 更新
     *

     * @Date 2020-12-15
     */
    void update(AreaParam param);

    /**
     * 查询单条数据，Specification模式
     *

     * @Date 2020-12-15
     */
    AreaResult findBySpec(AreaParam param);

    /**
     * 查询列表，Specification模式
     *

     * @Date 2020-12-15
     */
    List<AreaResult> findListBySpec(AreaParam param);

    /**
     * 查询分页数据，Specification模式
     *

     * @Date 2020-12-15
     */
    PageInfo adminFindPageBySpec(AreaParam param);

    List<Area> findByParentId(Long parentId);

    /**
     * @Description: 查找所有数据
     * @Date:2020/12/15 19:48
     * @Param: [area]

     */
    List<AreaResult> findListAllByAreaParam(AreaParam areaParam);


    List<ListTreeResult> findListTreeInfo(AreaParam areaParam);

    /**
     * 根据id查找省市区联动数据
     */
    AreaChain findAreaChain(AreaParam areaParam);

    List<Area> findByParent(long parentId);

    void clearAreaRedisCache();

    List<AreaResult> findByParentId(AreaParam areaParam);

    PageInfo findPageBySpec(AreaParam param);
}
